﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Model;

namespace DAL
{
    public  class LoginDAL:BaseDAL<Login>
    {
        public override string TableName
        {
            get { return "AuthorityAndRoles"; }
        }

        public override Dictionary<string, bool> PkName
        {
            get
            {

                Dictionary<string, bool> dic = new Dictionary<string, bool>();
                dic.Add("ID", true);
                return dic;
            }
        }
        public Login GetListID(Users user)
        {
            string sql = "select * from Users a join AuthorityAndRoles b on a.Roles_id=b.Roles_Id where Users_Account='" + user.Users_Account + "' and Users_Pwd='" + user.Users_Pwd + "'";
            return DBHelper.ExecuteObject<Login>(sql);
        }
    }
}
